package lab02.test23;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

/**
 * Created by V555 on 2017/11/2.
 */
public class Tst11 {
    public static void main(String[] args) throws ParseException {
        String birthday;
        Scanner scanner=new Scanner(System.in);
        System.out.println("please input your birthday:");
        birthday=scanner.nextLine();
        System.out.println(birthday);
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-mm-dd");
        //计算你的生日还有多少天
        Calendar calendar=Calendar.getInstance();
        calendar.setTime(sdf.parse(birthday));
        long time1=calendar.getTimeInMillis();
        calendar.setTime(sdf.parse("2017-11-02"));
        long time2=calendar.getTimeInMillis();
        System.out.println("距离你的生日还有"+(time1-time2)/(24*60*60*1000)+"天");
        //你的生日是星期几

    }
}
